package com.zzw.springboot.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

/**
 * 角色菜单关联实体类
 */
@ApiModel("角色菜单关联实体类")
@TableName("sys_role_menu")
@Data
public class SysRoleMenu {
    
    /**
     * 主键ID
     */
    @ApiModelProperty("主键ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    
    /**
     * 菜单ID
     */
    @ApiModelProperty("菜单ID")
    private Integer menuId;
    
    /**
     * 角色ID
     */
    @ApiModelProperty("角色ID")
    private Integer roleId;
    
    /**
     * 创建人
     */
    @ApiModelProperty("创建人")
    private String createBy;
    
    /**
     * 创建时间
     */
    @ApiModelProperty("创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;
    
    public SysRoleMenu() {
    }
    
    public SysRoleMenu(Integer menuId, Integer roleId) {
        this.menuId = menuId;
        this.roleId = roleId;
        this.createTime = new Date();
    }
    
    public SysRoleMenu(Integer menuId, Integer roleId, String createBy) {
        this.menuId = menuId;
        this.roleId = roleId;
        this.createBy = createBy;
        this.createTime = new Date();
    }
} 